//============================================================================
// Name        : practica2.cpp
// Author      : Carlos Alegría
// Description : Práctica #2 del capítulo de introducción a C++
//============================================================================

#include "Conacyt.h"
#include "Pronabe.h"
#include "EstudiantePoo.h"
#include <iostream>

using namespace poo;
using namespace std;

int
main()
{
  //
  // probando polimorfismo mediante la clase Beca
  //

  Conacyt *conacyt = new Conacyt("super-beca", MAESTRIA);
  Pronabe *pronabe = new Pronabe("pronabito", LICENCIATURA);
  Beca *beca;

  beca = static_cast<Beca *>(conacyt);
  cout << "probando beca conacyt: " << beca << " cantidad: "
      << beca->calcularCantidad(8.6) << endl;

  beca = pronabe;
  cout << "probando beca pronabe: " << beca << " cantidad: "
      << beca->calcularCantidad(8.6) << endl;
  cout << "------------------------------------------" << endl;

  delete conacyt;
  delete pronabe;

  beca = NULL;
  conacyt = NULL;
  pronabe = NULL;

  //
  // probando polimorfismo mediante la clase Beca
  //

  EstudiantePoo *e = new EstudiantePoo("un nombre", "una dirección", 56,
      "un rfc", "una empresa", "un número de cuenta", DOCTORADO, 7, 2);

  cout << "Probando estudiante poo" << endl;
  cout << "-----------------------" << endl;
  cout << e << endl;
  cout << "------------------------------------------" << endl;

  Estudiante *estudiante = e;
  cout << "Probando estudiante" << endl;
  cout << "-------------------" << endl;
  cout << estudiante << endl;
  cout << "------------------------------------------" << endl;

  Empleado *empleado = e;
  cout << "Probando empleado" << endl;
  cout << "-----------------" << endl;
  cout << empleado << endl;
  cout << "------------------------------------------" << endl;

  Persona *persona = e;
  cout << "Probando persona:" << endl;
  cout << "-----------------" << endl;
  cout << persona << endl;
  cout << "------------------------------------------" << endl;

  Empleado *empleado2 = dynamic_cast<Empleado *>(estudiante);
  cout << empleado2;

  return 0;
}
